<?php

namespace App\Repository\Api;

use App\Repository\BaseRepository;

class Ip138Repository extends BaseRepository
{
    private $oid;
    private $mid;
    private $token;

    public function __construct()
    {
        $this->oid = config('ip138.oid');
        $this->mid = config('ip138.mid');
        $this->token = config('ip138.token');
    }

    // 查询手机归属地的js 接口
    public function getCheckMobileJsUrl($mobile)
    {
        $sign = md5('mobile=' . $mobile . '&token=' . $this->token);
        return 'https://api.ip138.com/mobile/?mobile=' . $mobile . '&callback=&oid=' . $this->oid . '&mid=' . $this->mid . '&sign=' . $sign;
    }

}
